﻿/* 
 * Since 2008 - 2012
 */

package com.hh.bss.project.service.impl;

import org.springframework.dao.DataAccessException;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.*;

import com.hh.bss.base.*;
import com.hh.bss.common.page.*;
import com.hh.bss.common.page.impl.*;
import com.hh.bss.project.dao.*;
import com.hh.bss.project.entity.*;
import com.hh.bss.project.service.*;
import com.hh.bss.project.vo.query.*;
import com.hh.bss.util.*;




@Service
@Transactional
public class SearchProjectInterviewServiceImpl extends BaseBusinessService<SearchProjectInterview,java.lang.Integer>  implements SearchProjectInterviewService<SearchProjectInterview,java.lang.Integer>{

	private SearchProjectInterviewDao searchProjectInterviewDao;

	/**增加setXXXX()方法,spring就可以通过autowire自动设置对象属性,请注意大小写*/
	public void setSearchProjectInterviewDaoImpl(SearchProjectInterviewDao dao) {
		this.searchProjectInterviewDao = dao;
	}
	private SearchProjectCvService searchProjectCvService;
	public void setSearchProjectCvServiceImpl(SearchProjectCvService service) {
		this.searchProjectCvService = service;
	}
	public EntityDao getEntityDao() {
		return this.searchProjectInterviewDao;
	}
	
	@Transactional(readOnly=true)
	public Page findPage(SearchProjectInterviewQuery query) {
		return searchProjectInterviewDao.findPage(query);
	}
	public Page findConsultantInterviewPage(SearchProjectInterviewQuery query){
		return searchProjectInterviewDao.findConsultantInterviewPage(query);
	}
	public void save(SearchProjectInterview searchProjectInterview){
		searchProjectInterviewDao.save(searchProjectInterview);
		searchProjectInterviewDao.flush();
		SearchProjectCv searchProjectCv=new SearchProjectCv();
		searchProjectCv.setCvId(searchProjectInterview.getCvId());
		searchProjectCv.setProjectId(searchProjectInterview.getProjectId());
		searchProjectCv.setStatus(SearchProjectCv.STATUS_GI);
		searchProjectCvService.updateProjectCvStatus(searchProjectCv);
	}
	
	
	public SearchProjectInterview getSearchProjectInterviewById(Integer id){
		return  searchProjectCvService.getSearchProjectInterviewById(id);
	}
	
}
